{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">元</span>
                    <h5>押金</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" >{$all}</h1>
                    <small>押金总额</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">元</span>
                    <h5>昨日</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" >{$yesterday_in}</h1>
                    <small>昨日交押金总额</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">元</span>
                    <h5>昨日</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" >{$yesterday_out}</h1>
                    <small>昨日退押金总额</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">元</span>
                    <h5>今日</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" >{$today}</h1>
                    <small>今日退押金总额</small>
                </div>
            </div>
        </div>
    </div>
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <form class="layui-form" onsubmit="return false;" id="layuiForm">
                    <div class="layui-form layui-form-item">
                        <div class="layui-input-inline layui-form">
                            <select name="role" lay-search="">
                                <option  value="">不限机构</option>
                                <option  value="1">支付宝</option>
                                <option  value="2">微信</option>
                            </select>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="key" value="" placeholder="订单号"/>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="shopName" value="" placeholder="商铺"/>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn layuiBtn" type="button" data-type="excelAll">
                                导出EXCEL
                            </button>
                        </div>
                    </div>
                    </form>
                </div>
                <!--搜索框结束-->
                <div class="col-sm-12">
                    <div class="input-group">
                        <span id="shopBalance"></span>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        {{# if(d.o_tixian_status==1){ }}
                        <a href="javascript:;" onclick="check('{{d.o_id}}')" class="btn btn-primary btn-xs m-r-xs">审核</a>
                        {{# } }}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("money/cash")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            ,parseData: function(res){
                // console.log(res);
                if ('' != $('input[name="shopName"]').val()) {
                    $('#shopBalance').text('结余：' + res.shop_total)
                } else {
                    $('#shopBalance').text('');
                }
                return res;
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'type', width: '', title: '类型', align: 'center'}
                , {field: 'shop_name', width: '', title: '店铺', align: 'center'}
                , {field: 'o_order_num',width: '', title: '订单号', align: 'center'}
                , {field: 'o_money', width: '', title: '金额', align: 'center'}
                , {field: 'pay_type', width: '', title: '第三方', align: 'center'}
                , {field: 'o_add_time', width: '', title: '时间', align: 'center'}
            ]]
        });

        
        var $ = layui.$, active = {
            excelAll: function(){
                //导出Excel
                wk.excelAll([],$('#layuiForm').serialize(),"{:url('excelAdmin')}");
            }
        };
        $('.layuiBtn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
</body>
</html>